//
//  SaveTools.m
//  Tools
//
//  Created by dllo on 15/8/11.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "SaveTools.h"

@implementation SaveTools


//路径
+ (NSString *)pathWithName:(NSString *)name directory:(NSSearchPathDirectory)directory
{
    NSString *path = [NSSearchPathForDirectoriesInDomains(directory, NSUserDomainMask, YES) firstObject];
    path = [NSString stringWithFormat:@"%@/%@", path, name];
    return path;
}
//存文件
+ (BOOL)saveWithName:(NSString *)name
           directory:(NSSearchPathDirectory)directory
               value:(id)value
{
    NSString *path = [SaveTools pathWithName:name directory:directory];
    return [value writeToFile:path atomically:YES];
    
}



@end
